#ifndef PRINTDATABASE_H
#define PRINTDATABASE_H

#include "DataBase.h"

#include <QPrintDialog>
#include <QPainter>
#include <QPrinter>
#include <QLocale>

class PrintDatabase
{
private:
    DataBase *db;

    int n;  //number of items in database
    int t;  //interval value
    int hc; //cell height
    int pN; //page number
    int rN; //max row number on page

    QVector<int> w; //column width
    QRect tR, desR; //table and description Rects

    QPrinter *printer;

    void init();
    void drawDescription( QPainter *painter );
    void drawTable();

    QRect getCellRect( int x, int y );

public:
    PrintDatabase();

    void setDB( DataBase *db );
    void Print();
};

#endif // PRINTDATABASE_H
